﻿<%@ Page Language="C#" %>

<%@ Import Namespace="wojilu" %>
<%@ Import Namespace="wojilu.View" %>
<%@ Import Namespace="wojilu.Web.Controller" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Domain" %>
<%var site = v.data("site") as m_site; %>
<%var lngs = site.lngs; %>
<%var read = v.data("read") as System.Data.DataRow; %>
<%var typeread = v.data("typeread") as TypeList; %>

<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1; maximum-scale=1.0; user-scalable=no;"/>
	<meta name="apple-mobile-web-app-capable" content="yes">
	<title>#{pageTitle}</title>
	<link rel="stylesheet" href="#{site.waptemplates}css/touch-app.css" />
	<link rel="stylesheet" href="#{site.waptemplates}css/touch-slider.css" />
	<script src="#{site.waptemplates}js/zepto.min.js"></script>
	<script src="#{site.waptemplates}js/swipeslide.js"></script>
	<script src="#{site.waptemplates}js/touchapp.js"></script>
</head>
<body>
<style>
A.applink:hover {border: 2px dotted #DCE6F4;padding:2px;background-color:#ffff00;color:green;text-decoration:none}
A.applink       {border: 2px dotted #DCE6F4;padding:2px;color:#2F5BFF;background:transparent;text-decoration:none}
A.info          {color:#2F5BFF;background:transparent;text-decoration:none}
A.info:hover    {color:green;background:transparent;text-decoration:underline}
</style>
	<div class="ui-container">
		<section>
			<header>
				<div class="ui-header-bar">
					<a href="#{site.dir}wap/" class="ui-gohomepage"></a>
					<div class="ui-pagetitle"><%=typeread.typename %></div>
				</div>
			</header>

			            <!-- @end swipe -->
                        			<div class="ui-video-list ui-category-list ui-model-left">
                                        <%var pagelist = v.data("pagelist") as DataPage<Document>; %>
									<ul id="common-item">
                                        <%if(pagelist.RecordCount>0){ %>
                                        <%foreach (var row1 in pagelist.Results) { %>
								          <li>
											<a href="<%=row1.readwaplink %>">								<div class="ui-video-thumb">
                                                <%if(row1.pic !=""){ %>
														<img src="<%=row1.pic %>" width="80" height="60" alt="">
                                                <%}else{ %>
                                                <img src="#{site.waptemplates}images/yw.jpg" width="80" height="60" alt="">
                                                <%} %>
													</div>
											<h3><%=row1.title %></h3>
												<p><%=YBBCommon.LeftByt(YBBCommon.RemoveHtml(row1.content),160) %>...</p>
											</a>
										</li><%} %><%} %>
                                        
                    			                    				</ul>
                				<a class="ui-more" page="2" param="#" href="javascript:void(0)">查看更多</a>
								
                			</div>
            		</section>
	</div>
   
    
    <!-- 底部 -->
    <footer class="ui-bottom-bar">
        <p>#{site.copyright}</p>
<div class="ui-menu-trigger js-menubtn-bottom"></div>    </footer>
	<script>
	$(function() {
			// 底部栏目选择
			var bb = $('.js-menubtn-bottom');
			bb.click(function() {
				$('.js-categorys-bottom').toggleClass('js-hidden');
				setTimeout(function() {
					document.body.scrollTop = document.body.clientHeight;
				}, 50);
			});	
		
			//GETMORE
			var pagebtn = $(".ui-more");
			var item_ul = $("#common-item");
			pagebtn.click(function(a) {
				a && a.preventDefault();
				var nextpage = $(this).attr('page'),pageParams = $(this).attr('param');
				$.ajax({
				    type: "POST", url: "/wap/article/list/<%=typeread.Id%>/showpage.aspx", data: { page: nextpage }, dataType: "json", beforeSend: function () {
					pagebtn.html("加载中&hellip;")
				},success: function(b) {
					if (b.status === 1) {
						var i=0;
						b.items.forEach(function(item) {
							var picstr="";
							if(item.litpic!=''){
								picstr="<div class=\"ui-video-thumb\"><img src=\""+item.litpic+"\" width=\"80\" height=\"60\"></div>";
							}
							var d="<li><a href=\"article.php?id="+item.id+"\">"+picstr+"<h3>"+item.title+"</h3><p>"+item.description+"...</p></a></li>";
							i++;
							item_ul.append(d);
						});

						var n = b.items.length * (nextpage-1);

						nextpage = parseInt(nextpage) + 1;
						pagebtn.attr("page", nextpage);
						nextpage <= b.pageCount ? pagebtn.html('查看更多&hellip;') : pagebtn.html('没有更多文章').unbind("click")
					} else {
						pagebtn.html('没有更多文章').unbind("click");
					}
				},error: function() {
					pagebtn.html('没有更多文章').unbind("click");
				}})
			});

	});
    </script>
</body>
</html>